package icu.feigroup.domain.activity.service.trial.factory;

import icu.feigroup.domain.activity.model.entity.MarketProductEntity;
import icu.feigroup.domain.activity.model.entity.TrialBalanceEntity;
import icu.feigroup.domain.activity.model.valobj.GroupActivityDiscountVO;
import icu.feigroup.domain.activity.model.valobj.SkuVO;
import icu.feigroup.domain.activity.service.trial.node.RootNode;
import icu.feigroup.types.design.framwork.tree.StrategyHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * projectName:icu.feigroup.domain.activity.service.trial.factory
 *
 * @author 飞
 * @since 2025/2/19 11:38
 * description:活动策略工厂
 */
@Service
public class DefaultActivityStrategyFactory {
    private final RootNode rootNode;

    public DefaultActivityStrategyFactory(RootNode rootNode) {
        this.rootNode = rootNode;
    }

    public StrategyHandler<MarketProductEntity, DynamicContext, TrialBalanceEntity> strategyHandler() {
        return rootNode;
    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class DynamicContext {
        private GroupActivityDiscountVO groupActivityDiscountVO;
        private SkuVO skuVO;
        private BigDecimal deductionPrice;
        private BigDecimal payPrice;
        private boolean visible;
        private boolean enable;
    }
}
